package cn.iocoder.yudao.module.dify.dal.mysql.translationtaskfile;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.dify.dal.dataobject.translationtaskfile.TranslationTaskFileDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.dify.controller.admin.translationtaskfile.vo.*;

/**
 *  翻译工作流任务文件 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface TranslationTaskFileMapper extends BaseMapperX<TranslationTaskFileDO> {

    default PageResult<TranslationTaskFileDO> selectPage(TranslationTaskFilePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TranslationTaskFileDO>()
                .eqIfPresent(TranslationTaskFileDO::getDifyTranslationTaskRecordsId, reqVO.getDifyTranslationTaskRecordsId())
                .eqIfPresent(TranslationTaskFileDO::getFileId, reqVO.getFileId())
                .likeIfPresent(TranslationTaskFileDO::getOriginalName, reqVO.getOriginalName())
                .eqIfPresent(TranslationTaskFileDO::getOriginalUrl, reqVO.getOriginalUrl())
                .eqIfPresent(TranslationTaskFileDO::getMinioUrl, reqVO.getMinioUrl())
                .eqIfPresent(TranslationTaskFileDO::getTotalTokens, reqVO.getTotalTokens())
                .eqIfPresent(TranslationTaskFileDO::getProcessStatus, reqVO.getProcessStatus())
                .eqIfPresent(TranslationTaskFileDO::getRetryCount, reqVO.getRetryCount())
                .eqIfPresent(TranslationTaskFileDO::getReviewStatus, reqVO.getReviewStatus())
                .eqIfPresent(TranslationTaskFileDO::getReviewUrl, reqVO.getReviewUrl())
                .betweenIfPresent(TranslationTaskFileDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TranslationTaskFileDO::getId));
    }

}